﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace DbUp
{

    public class NoVersionKeyFoundException : Exception
    {
        public NoVersionKeyFoundException(string fileName)
            : base("A version key could not be found in file " + fileName + ". Please specify the version key with the following format '-- Version: {GUID}' (replacing {GUID} with a valid guid key")
        {
        }
    }

    public class DuplicateVersionKeyFoundException : Exception
    {
        public DuplicateVersionKeyFoundException(IEnumerable<string> filesWithDuplicateKey, Guid version)
            : base(string.Format("Duplicate version keys [{0}] were found in the following files [{1}].", version, string.Join(", ", filesWithDuplicateKey.ToArray())))
        {
        }
    }


}